package chzhenjia.learn.androidcode.config;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;

import chzhenjia.learn.androidcode.dial.DialActivity;
import chzhenjia.learn.androidcode.dialog.DialogActivity;
import chzhenjia.learn.androidcode.four.FourOneActivity;
import chzhenjia.learn.androidcode.four.GetAndPostMethodActivity;
import chzhenjia.learn.androidcode.four.MultiDownloadActivity;
import chzhenjia.learn.androidcode.four.SmartImageActivity;
import chzhenjia.learn.androidcode.four.XUtilsActivity;
import chzhenjia.learn.androidcode.one.OneActivity;
import chzhenjia.learn.androidcode.sms.SmsActivity;
import chzhenjia.learn.androidcode.two.LoginActivity;
import chzhenjia.learn.androidcode.two.ShowTotalSdcardActivity;

/**
 * 用来配置所有的 Activity,每加一个案例这里都要配置一下,除了那些副的不需要添加,还有 MainActivity也是不需要添加
 *
 * @author 陈圳佳
 *         日期:2015/7/11
 */
public class ApplicationConfig {

    private ApplicationConfig() {
    }

    private static Map<String, Class<?>> classMap = new TreeMap<>();

    static {
        classMap.put("快速入门", OneActivity.class);
        classMap.put("演示读写内部存储", LoginActivity.class);
        classMap.put("获取SD卡的剩余和总量", ShowTotalSdcardActivity.class);
        classMap.put("拨打电话演示", DialActivity.class);
        classMap.put("发送短信演示", SmsActivity.class);
        classMap.put("对话框演示", DialogActivity.class);
        classMap.put("Android 网络编程演示", FourOneActivity.class);
        classMap.put("使用别人的开源项目,SmartImageView", SmartImageActivity.class);
        classMap.put("get 和 post 请求演示", GetAndPostMethodActivity.class);
        classMap.put("多线程下载演示", MultiDownloadActivity.class);
        classMap.put("XUtils下载演示", XUtilsActivity.class);
    }

    public static List<String> getClassList() {
        Set<String> strings = classMap.keySet();
        return new ArrayList<>(strings);
    }

    public static Class<?> getActivity(String key) {
        return classMap.get(key);
    }
}
